Named structure initialization. A GCC extension. Non-standard, and extremely useful.
Does that mean we should burn the GCC authors in hell? Nah.
Named structure initialization. A GCC extension. Non-standard, and extremely useful.
Does that mean we should burn the GCC authors in hell? Nah.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
For the record, named initializers were introduced in the C99 standard, but have to use a dot. Check section 6.7.8, item 34 of this document: http://www.open-std.org/jtc1/sc22/wg...docs/n1124.pdf.
Named initializers using a : are a GNU extension that they deprecated in gcc 2.5! Check the current docs here: Designated Inits - Using the GNU Compiler Collection (GCC). Very old stuff, considering the current version is 4.5.1. So, using .member to initialize is fine and should be portable. Using the : is not and should be avoided.
brewbuck.... So long as you realize it is non-standard and may not be supported either in other compilers or future releases of GCC... I don't see the problem.
That said... I would probably never use it.